fn main() {
    let mut v1: Vec<i32> = Vec::new();
    // let mut v2 = vec![1, 2];

    v1.push(1);
    v1.push(2);

    v1[1] = 4;

    println!("=====访问元素=====");

    println!("v1[0]={}", v1[0]);

    match v1.get(0) {
        Some(value) => println!("v1[0]={}", value),
        None => println!("none"),
    }

    println!("=====遍历元素=====");
    // for item in &v1 {
    //     println!("{}", item);
    // }

    for item in &mut v1 {
        // *item += 50;
        // *item = *item +1 ;
        println!("{}", item);
    }

    println!("=====补充=====");
    {
        let mut v = vec![1, 2,3, 4, 5];
        let mut  first = v[0];
        v.push(6);
        println!("first={}", first);
    }

}
